
*Required packages
ssc install ftools
ssc install reghdfe
ssc install outreg2

*Set working directory
cd "/path/to/replication"

*Open data
u "data/panel_month_dummies.dta", clear

*Define full set of controls
global FE panelvar timevar b157.timevar#c.foreign_pop b157.timevar#c.educ_diplba


* Table D5: Flexibly control for youth unemp and pop dens
	reghdfe hc_pc_asians i.covid2##i.losing_income_d timevar_losingincome timevar_province, absorb(b157.timevar#c.unemp_young panelvar timevar) cluster(panelvar)
	outreg2 using "tableD5.tex", replace tex dec(5) keep(1.covid2#1.losing_income_d) ctitle("Control for", "Youth Unemp") addtext(Month FE, Y, Municipality FE, Y, Group-specific linear trends, Y, Province-specific linear trends, Y)  nocons

	reghdfe hc_pc_asians i.covid2##i.losing_income_d timevar_losingincome timevar_province, absorb(b157.timevar#c.pop_dens panelvar timevar) cluster(panelvar)
	outreg2 using "tableD5.tex", tex dec(5) keep(1.covid2#1.losing_income_d) ctitle("Control for", "Pop Dens") addtext(Month FE, Y, Municipality FE, Y, Group-specific linear trends, Y, Province-specific linear trends, Y)  nocons
